package com.zj.core.net

import com.google.gson.Gson
import com.google.gson.JsonParser
import com.log.Logger
import com.dialogutils.ToastUtil
import com.zj.core.activity.RecordActivity.Companion.commitStatu
import com.zj.core.base.BaseApplication.Companion.context
import com.zj.core.bean.*
import com.zj.core.bean.bean_input.BindNurseNameInputBean
import com.zj.core.bean.bean_input.QueryNurseInfoInputBean
import java.io.IOException
import java.util.HashMap
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
import okhttp3.ResponseBody

/**
 * 日期：2019年3月22日
 * 公司：北京子杰宝贝科技有限公司
 * 地址：北京市朝阳区朝阳农场
 * 开发者：达选文
 *
 * 主体功能：网络返回数据 处理
 */
class NetPresenter {

    /**
     * 1.4.1 获取护士或患者操作记录
     * @param callBackIml   回调实现
     * @param hospitalID    医院ID
     * @param departmentID  科室ID
     * @param pageIndex     （1）
     * @param nurseID       护士ID
     * @param patientID     患者ID
     * @param endTime       结束时间
     * @param startTime     开始时间
     */
    fun getNurseOperationRecord(
        callBackIml: NetValueCallBackIml,
        hospitalID: String,
        departmentID: String,
        pageIndex: Int,
        nurseID: String?="",
        patientID: String? = "",
        message: String? = "",
        endTime: String? = "",
        startTime: String? = ""
    ) {
        val entity = BaseRecordBean.DatEntity.NurseRecordBean()
        entity.msg = message
        entity.patientid = patientID

        if (endTime == "") {
            entity.createendtime = null
        } else {
            entity.createendtime = endTime
        }

        entity.createstarttime = startTime

        entity.nurseid = nurseID
        entity.hospitalid = hospitalID
        entity.departmentid = departmentID

        val parans = BaseRecordBean.DatEntity()
        parans.pageindex = pageIndex
        parans.paramlist = entity

        val requestBody = BaseRecordBean()
        requestBody.dat = parans

        val logValue = Gson().toJson(requestBody)
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getNurseOperationRecord(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {
                callBackIml.onComplete()
            }

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val mResBean = Gson().fromJson<NurseRecResBean>(
                        responseBody.string(),
                        NurseRecResBean::class.java
                    )
                    callBackIml.onNext(mResBean, null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
//                saveData(e.toString(), logValue, "", "操作记录")
                callBackIml.onError()
            }

            override fun onComplete() {
                callBackIml.onComplete()
            }
        }, map)
    }

    /**
     * 1.4.3 修改操作记录备注
     * @param callBackIml   回调实现
     * @param ID            患者记录单ID
     * @param patientMsg    患者信息（备注）
     * @param patientID     患者ID
     * @param hospitalID    医院ID
     * @param departmentID  科室ID
     */
    fun addRemarkForOperation(
        callBackIml: NetValueCallBackIml,
        ID: String,
        patientMsg: String?,
        patientID: String,
        hospitalID: String,
        departmentID: String
    ) {
        val mBean = AnnotationBean.DatEntity()
        mBean.msg = patientMsg
        mBean.id = ID
        mBean.patientid = patientID
        mBean.hospitalid = hospitalID
        mBean.departmentid = departmentID

        val parans = AnnotationBean()
        parans.dat = mBean

        val logValue = Gson().toJson(parans)
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_addRemarkForOperation(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {
                callBackIml.onComplete()
            }

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val returnData = JsonParser().parse(responseBody.string()).asJsonObject
                    val str = returnData.get("msg").asString
                    if (str == "更新成功") {
                        callBackIml.onNext(null, null)
                    }
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
//                saveData(e.toString(), logValue, "", "修改操作记录")
                callBackIml.onError()
            }

            override fun onComplete() {
                callBackIml.onComplete()
            }
        }, map)
    }

    /**
     * 1.4.12 获取语音模板
     * @param callBackIml   回调实现
     * @param title         （模版索引作用）
     * @param hospitalID    医院ID
     * @param departmentID  科室ID
     */
    fun getVoiceTemplate(
        callBackIml: NetValueCallBackIml?,
        title: String,
        hospitalID: String,
        departmentID: String
    ) {
        val paramBean = VoiceTemplateBean.DatEntity.ParamlistEntity()
        paramBean.departmentid = departmentID
        paramBean.hospitalid = hospitalID
        paramBean.meaning = title

        val datBean = VoiceTemplateBean.DatEntity()
        datBean.paramlist = paramBean

        val template = VoiceTemplateBean()
        template.dat = datBean

        val logValue = Gson().toJson(template)
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getVoiceTemplate(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {
                Logger.debug("TAG", "")
            }

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val wordBean = Gson().fromJson<VoiceTemplateBean.VoiceWordBean>(
                        responseBody.string(), VoiceTemplateBean.VoiceWordBean::class.java
                    )
                    callBackIml?.onNext(wordBean.dat?.rows, title)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
//                saveData(e.toString(), logValue, "", "语音模板")
            }

            override fun onComplete() {
                Logger.debug("TAG", "")
            }
        }, map)
    }

    /**
     * 1.4.16 获取科室配置信息
     * @param callBackIml   回调实现
     * @param imei          设备imei
     */
    fun getApplyCationConfig(
        callBackIml: NetValueCallBackIml?,
        imei: String?
    ) {
        val mDat = ImeiConfigBean.DatEntity()
        mDat.paramlist = ImeiConfigBean.DatEntity.ParamlistEntity().setMac(imei)

        val mImei = ImeiConfigBean()
        mImei.dat = mDat

        val logValue = Gson().toJson(mImei)
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getConfigMes(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {}

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val str = responseBody.string()
                    val mImeiBean = Gson().fromJson<ImeiConfigBean.ImeiConfigResultBean>(
                        str, ImeiConfigBean.ImeiConfigResultBean::class.java
                    )
                    val mListConfig = mImeiBean.dat?.rows
                    if (mListConfig?.size == 0) {
                        callBackIml?.onError()
//                        saveData("科室配置信息获取为空", logValue, "", "科室配置信息为空")
                    } else {
                        callBackIml?.onNext(
                            mListConfig?.get(0)?.departmentid.toString(),
                            mListConfig?.get(0)?.hospitalid.toString()
                        )
                    }
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
                callBackIml?.onError()
//                saveData(e.toString(), logValue, "", "科室配置信息")
            }

            override fun onComplete() {}
        }, map)
    }

    /**
     * 1.4.20 获取模板关键字列表
     * @param callBackIml      回调实现
     * @param departmentID     医院ID
     * @param hospitalID       科室ID
     */
    fun getTemplateTitle(
        callBackIml: NetValueCallBackIml,
        departmentID: String,
        hospitalID: String
    ) {
        val paramBean = VoiceTemplateBean.DatEntity.ParamlistEntity()
        paramBean.departmentid = departmentID
        paramBean.hospitalid = hospitalID

        val datBean = VoiceTemplateBean.DatEntity()
        datBean.paramlist = paramBean

        val template = VoiceTemplateBean()
        template.dat = datBean

        val logValue = Gson().toJson(template)
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getTemplateTitle(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {
                Logger.debug("TAG", "onSubscribe")
            }

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val wordBean =
                        Gson().fromJson<TemplateTitleBean>(
                            responseBody.string(),
                            TemplateTitleBean::class.java
                        )
                    callBackIml.onNext(wordBean.dat?.rows, null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
            }

            override fun onComplete() {
                Logger.debug("TAG", "onComplete")
            }
        }, map)
    }

    /**
     * 1.4.25 查询护士信息
     * @param callBackIml   回调实现
     * @param hospitialID   医院ID
     * @param departmentID  科室ID
     * @param nurseID       护士ID
     * @param status        在职/离职
     */
    fun queryNurseName(
        callBackIml: NetValueCallBackIml,
        hospitialID: String,
        departmentID: String,
        nurseID: String,
        status: String
    ) {
        // 实体封装
        val paramlist = QueryNurseInfoInputBean.Dat.Paramlist(
            hospitalid = hospitialID,
            departmentid = departmentID,
            nurseid = nurseID,
            orderby = "",
            status = status
        )
        val inputBean = QueryNurseInfoInputBean(QueryNurseInfoInputBean.Dat(paramlist = paramlist))

        // 数据封装
        val jsonString = Gson().toJson(inputBean)
        val map = HashMap<String, String>()
        map[jsonString] = ""

        // 回调处理
        NetWorkModel().rxjava_queryNurseInfo(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {
                callBackIml.onComplete()
            }

            override fun onNext(responseBody: ResponseBody) {
                try {
                    callBackIml.onNext(responseBody.string(), null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
                callBackIml.onError()
            }
            override fun onComplete() {}
        }, map)
    }

    /**
     * 1.4.26 绑定护士姓名
     * @param callBackIml 回调实现
     * @param hospitialID 医院ID
     * @param departmentID 科室ID
     * @param nurseID 护士ID
     * @param nurseName 护士Name
     */
    fun BindNurseInfo(
        callBackIml: NetValueCallBackIml,
        hospitialID: String,
        departmentID: String,
        nurseID: String,
        nurseName: String
    ) {
        // 实体封装
        val dat = BindNurseNameInputBean.Dat(
            nurseid = nurseID,
            hospitalid = hospitialID,
            departmentid = departmentID,
            nursename = nurseName
        )
        val inputBean = BindNurseNameInputBean(dat = dat)

        // 数据封装
        val jsonString = Gson().toJson(inputBean)
        val map = HashMap<String, String>()
        map[jsonString] = ""

        // 回调处理
        NetWorkModel().rxjava_bindNurseName(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {
                callBackIml.onComplete()
            }

            override fun onNext(responseBody: ResponseBody) {
                try {
                    callBackIml.onNext(responseBody.string(), null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
                callBackIml.onError()
            }

            override fun onComplete() {}
        }, map)
    }

    /**
     * 1.4.29 获取演示视频信息
     * @param callBackIml   回调实现
     */
    fun getVideoMessage(
        callBackIml: NetValueCallBackIml?
    ) {
        val logValue = "{\"dat\":{\"title\":\"\",\"status\":0}}"
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getVideoMessage(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {}

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val mResBean = Gson().fromJson<VideoMesBean>(
                        responseBody.string(),
                        VideoMesBean::class.java
                    )
                    callBackIml?.onNext(mResBean.dat?.rows, null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
                ToastUtil.showShort(context, "帮助信息获取失败")
            }

            override fun onComplete() {}
        }, map)
    }

    /**
     * 1.4.30 获取药品名称列表
     * @param callBackIml
     */
    fun getDrugsList(
        callBackIml: NetValueCallBackIml?
    ) {
        val logValue = "{\"dat\":{\"pagesize\":9999999999999999}}"
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getDrugsList(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {}

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val mResBean = Gson().fromJson<DrugsListBean>(
                        responseBody.string(),
                        DrugsListBean::class.java
                    )
                    callBackIml?.onNext(mResBean.dat?.rows, null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
                ToastUtil.showShort(context, "表单数据获取失败")
//                saveData(e.toString(), logValue, "", "表单列表")
            }

            override fun onComplete() {}
        }, map)
    }

    /**
     * 1.4.31 app版本更新
     * @param callBackIml 回调实现
     */
    fun updateVersion(
        callBackIml: NetValueCallBackIml?
    ) {
        val logValue = "{\"cmd\":\"select\",\"dat\":{\"paramlist\":{\"versionname\":\"\",\"status\":\"\",\"orderby\":\" id desc\"},\"pageindex\":\"1\",\"pagesize\":\"10\"},\"ver\":\"1\",\"src\":\"1\"}}"
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_updateVersion(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {}

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val mResBean =
                        Gson().fromJson<UpdateBean>(responseBody.string(), UpdateBean::class.java)
                    callBackIml?.onNext(mResBean.dat?.rows, null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
                ToastUtil.showShort(context, "更新内容获取失败")
            }

            override fun onComplete() {}
        }, map)
    }


    /**
     * 1.4.32 获取表单列表
     * @param callBackIml   回调实现
     * @param hospitalID    医院ID
     * @param departmentID  科室ID
     */
    fun getFormList(callBackIml: NetValueCallBackIml?,
                    hospitalID: String,
                    departmentID: String
    ) {
        val logValue =
            "{\"dat\":{\"departmentid\":\"$departmentID\",\"hospitalid\":\"$hospitalID\"}}"
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getFormList(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {}

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val mResBean = Gson().fromJson<FormListBean>(
                        responseBody.string(),
                        FormListBean::class.java
                    )
                    callBackIml?.onNext(mResBean.dat?.rows, null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
                ToastUtil.showShort(context, "表单数据获取失败")
//                saveData(e.toString(), logValue, "", "表单列表")
            }

            override fun onComplete() {}
        }, map)
    }

    /**
     * 1.4.33 获取护理等级
     * @param callBackIml   回调实现
     * @param hospitalID    医院ID
     */
    fun getNurseLevel(
        callBackIml: NetValueCallBackIml?,
        hospitalID: String
    ) {
        val logValue = "{\"dat\":{\"hospitalid\":\"$hospitalID\"}}"
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getNurseLevel(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {}

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val mResBean = Gson().fromJson<NurseLevelBean>(
                        responseBody.string(),
                        NurseLevelBean::class.java
                    )
                    callBackIml?.onNext(mResBean.dat?.rows, null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
                ToastUtil.showShort(context, "护理等级获取失败")
//                saveData(e.toString(), logValue, "", "护理等级获取失败")
            }

            override fun onComplete() {}
        }, map)
    }

    /**
     * 1.4.34 操作记录提交
     *
     * @param callBackIml   回调实现
     * @param status        （新增0，修改1）
     * @param hospitalID    医院ID
     * @param departmentID  科室ID
     * @param patientID     患者ID
     * @param nurseID       护士ID
     * @param voice         （规则数据）
     * @param template
     * @param form          （废弃）
     * @param ctime         （中文时间转化）
     */
    fun postVoiceHistory(
        callBackIml: NetValueCallBackIml,
        status: Int,
        hospitalID: String,
        departmentID: String,
        patientID: String?,
        nurseID: String?,
        voice: String,
        template: String,
        form: String,
        ctime: String
    ) {
        if (hospitalID == "") {
            if (departmentID == "") {
                commitStatu = true
                ToastUtil.showShort(context, "医院ID与科室ID为空")
                return
            }
            commitStatu = true
            ToastUtil.showShort(context, "医院ID为空")
            return
        }

        if (departmentID == "") {
            if (hospitalID == "") {
                commitStatu = true
                ToastUtil.showShort(context, "医院ID与科室ID为空")
                return
            }
            commitStatu = true
            ToastUtil.showShort(context, "科室ID为空")
            return
        }

        val mHisBean = CommitHistoryBean.NurseRecordBean()
        mHisBean.status = status.toString()
        mHisBean.hospitalid = hospitalID
        mHisBean.departmentid = departmentID
        mHisBean.patientid = patientID
        mHisBean.nurseid = nurseID
        mHisBean.voice = voice
        mHisBean.measure = template
        mHisBean.options = form
        mHisBean.chtime = ctime

        val mCommitBean = CommitHistoryBean()
        mCommitBean.dat = mHisBean

        val logValue = Gson().toJson(mCommitBean)
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_postVoiceHistory(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {}

            override fun onNext(responseBody: ResponseBody) {
                try {
                    callBackIml.onNext(responseBody.string(), null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
//                saveData(e.toString(), logValue, nurseid, "保存数据")
                callBackIml.onError()
            }

            override fun onComplete() {}
        }, map)
    }

    /**
     * 1.4.35 获取表单内容关键字
     * @param callBackIml   回调实现
     * @param hospitalID    医院ID
     * @param departmentID  科室ID
     *
     */
    fun getFormKey(callBackIml: NetValueCallBackIml,
                   departmentID: String,
                   hospitalID: String

    ) {
        val logValue = "{\"dat\":{\"paramlist\":{\"departmentid\":\"$departmentID\",\"hospitalid\":\"$hospitalID\"}}}"
        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getFormKey(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {
                Logger.debug("TAG", "onSubscribe")
            }

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val wordBean = Gson().fromJson<FormKeySelectBean>(
                        responseBody.string(),
                        FormKeySelectBean::class.java
                    )
                    callBackIml.onNext(wordBean.dat?.rows, null)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
//                saveData(e.toString(), logValue, "", "表单关键字")
                callBackIml.onError()
            }

            override fun onComplete() {
                Logger.debug("TAG", "onComplete")
            }
        }, map)
    }

    /**
     * 1.4.36 获取入院状态关键字
     * @param callBackIml   回调实现
     * @param hospitalID    医院ID
     * @param rowsBean
     */
    fun getHospitalStatusKey(
        callBackIml: NetValueCallBackIml,
        hospitalID: String,
        rowsBean: ArrayList<FormKeySelectBean.DatBean.RowsBean>?

    ) {
        val logValue = "{\"dat\":{\"paramlist\":{\"hospitalid\":\"$hospitalID\"}}}"

        val map = HashMap<String, String>()
        map[logValue] = ""

        NetWorkModel().rxjava_getHospitalStatusKey(object : Observer<ResponseBody> {
            override fun onSubscribe(d: Disposable) {
                Logger.debug("TAG", "onSubscribe")
            }

            override fun onNext(responseBody: ResponseBody) {
                try {
                    val wordBean = Gson().fromJson<HospitalStatuBean>(
                        responseBody.string(),
                        HospitalStatuBean::class.java
                    )
                    callBackIml.onNext(wordBean.dat?.rows, rowsBean)
                } catch (e: IOException) {
                    e.printStackTrace()
                }
            }

            override fun onError(e: Throwable) {
//                saveData(e.toString(), "", "", "入院状态")
                callBackIml.onError()
            }

            override fun onComplete() {
                Logger.debug("TAG", "onComplete")
            }
        }, map)
    }




//    /**
//     * 新增患者备注
//     *
//     * @param departmentid
//     * @param hospitalid
//     */
//    fun addPatientRemark(
//        formArrIml: NetValueCallBackIml,
//        partientid: String,
//        partientmsg: String?
//    ) {
//        val logValue = "{\"dat\":{\"patientid\":\"$partientid\",\"patientmsg\":\"$partientmsg\"}}"
//        val map = HashMap<String, String>()
//        map[logValue] = ""
//
//        NetWorkModel().rxjava_patientRemark(object : Observer<ResponseBody> {
//            override fun onSubscribe(d: Disposable) {
//                Logger.debug("TAG", "onSubscribe")
//            }
//
//            override fun onNext(responseBody: ResponseBody) {
//                try {
//                    val returnData = JsonParser().parse(responseBody.string()).asJsonObject
//                    val str = returnData.get("msg").asString
//                    if (str == "更新成功") {
//                        formArrIml.onNext(null, null)
//                    }
//                } catch (e: IOException) {
//                    e.printStackTrace()
//                }
//            }
//
//            override fun onError(e: Throwable) {
//                saveData(e.toString(), logValue, "", "患者备注")
//                formArrIml.onError()
//            }
//
//            override fun onComplete() {
//                Logger.debug("TAG", "onComplete")
//            }
//        }, map)
//    }

//    /**
//     * 获取患者备注
//     *
//     * @param departmentid
//     * @param hospitalid
//     */
//    fun getPatientRemark(formArrIml: NetValueCallBackIml, partientid: String) {
//        val logValue = "{\"dat\":{\"patientid\":\"$partientid\"}}"
//        val map = HashMap<String, String>()
//        map[logValue] = ""
//
//        NetWorkModel().rxjava_getPatientRemark(object : Observer<ResponseBody> {
//            override fun onSubscribe(d: Disposable) {
//                Logger.debug("TAG", "onSubscribe")
//            }
//
//            override fun onNext(responseBody: ResponseBody) {
//                val wordBean = Gson().fromJson<PatientRemarkBean>(
//                    responseBody.string(),
//                    PatientRemarkBean::class.java
//                )
//                formArrIml.onNext(wordBean.dat?.rows, null)
//            }
//
//            override fun onError(e: Throwable) {
//                saveData(e.toString(), logValue, "", "查询患者备注")
//                formArrIml.onError()
//            }
//
//            override fun onComplete() {
//                Logger.debug("TAG", "onComplete")
//            }
//        }, map)
//    }

















//    fun saveData(errorMes: String?, sourceMes: String?, nurseId: String?, type: String?) {
//        //BmobDataUtils().saveData(errorMes, sourceMes, SystemUtil.getIMEI(BaseApplication.context),nurseId,type)
//    }
}